Skip to content

Conversation

@simonbaird
Copy link
Member

The motivation is to make sure PR #2656 doesn't change this behavior and potentially break things.

The two things being verified:

  • If the value of the top level key is a map, then the map keys from each data source get merged
  • If the value of the top level key is not a map, then we fail hard with an error.

Ref: https://issues.redhat.com/browse/EC-1418

@codecov
Copy link

codecov bot commented Aug 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
generative 66.57% <ø> (ø)
integration 66.57% <ø> (ø)
unit 66.57% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

successes: null
violations: []
warnings:
- msg: '{"george":"lead","john":"rhythm","paul":"bass","ringo":"drums"}'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the important part. Notice how we get the merged data.

---

[multiple data source top level key clash:stderr - 1]
Error: error validating file input.json: evaluating policy: load: load documents: 1 error occurred during loading: ${TEMP}/ec-work-${RANDOM}/dat${RANDOM}/${RANDOM}/data.yaml: merge error
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The merge error.

@simonbaird
Copy link
Member Author

IIUC the tekton lint failure is one we usually ignore. Actually I created #2682 to squelch it.

@simonbaird simonbaird force-pushed the rego-data-merge-tests branch from bbdebd7 to 1d1b378 Compare August 8, 2025 15:16
@simonbaird
Copy link
Member Author

Rebased to remove tekton lint fails.

The motivation is to make sure PR conforma#2656 doesn't change this behavior
and potentially break things.

The two things being verified:
- If the value of the top level key is a map, then the map keys
  from each data source get merged
- If the value of the top level key is not a map, then we fail
  hard with an error.

Ref: https://issues.redhat.com/browse/EC-1418
Should fix a go mod tidy lint error.
@simonbaird simonbaird force-pushed the rego-data-merge-tests branch from 1d1b378 to 2e98f3e Compare August 8, 2025 15:38
@simonbaird
Copy link
Member Author

Fixed two more lint errors, one about the license preamble, and one go mod tidy.

Hopefully good now, will set it to automerge and 🤞 .

@simonbaird simonbaird enabled auto-merge August 8, 2025 15:40
@simonbaird simonbaird merged commit 9663dc7 into conforma:main Aug 8, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants